package com.anxinr.mapper;

import com.anxinr.pojo.base.QueryBase;
import com.anxinr.pojo.dto.CommodityDTO;
import com.anxinr.pojo.entity.Commodity;
import com.anxinr.pojo.entity.OrderGoods;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author anxinr
 */
@Mapper
public interface CommodityMapper extends BaseMapper<Commodity> {

    /**
     * 查询
     * @param commodity
     * @return
     */
    List<CommodityDTO> queryCommodity(@Param("commodity") QueryBase<CommodityDTO> commodity);
    /**
     * 减库存
     * @param goods
     */
    void reduceShopCommodity(@Param("goods") OrderGoods goods);
}
